import { Component } from '@angular/core';
import { ThreeHundredItem } from './th-item';
import { ThreeHundredItemPlaceholder } from './th-item-placeholder';

@Component({
	selector: 'spartan-three-hundred',
	imports: [ThreeHundredItem, ThreeHundredItemPlaceholder],
	host: {
		class: 'relative grid gap-2 grid-cols-3 sm:grid-cols-5 lg:grid-cols-10',
	},
	template: `
		@for (contributor of _contributors; track $index) {
			<spartan-th-item class="mb-2" [contributor]="contributor" />
		}
		@for (_ of _rest; track $index) {
			<spartan-th-item-placeholder class="mb-2 hidden md:inline-flex" />
		}
		<div class="from-background pointer-events-none absolute right-0 bottom-0 left-0 h-3/12 bg-gradient-to-t"></div>
	`,
})
export class ThreeHundred {
	protected readonly _contributors = [
		'goetzrobin',
		'thatsamsonkid',
		'elite-benni',
		'ashley-hunter',
		'marcjulian',
		'MerlinMoos',
		'zeropsio',
		'snydertechnologies',
		'mihajm',
		'ajitzero',
		'arturgawlik',
		'deepakrudrapaul',
		'evanfuture',
		'AdditionAddict',
		'Altamimi-Dev',
		'ferat',
		'jeremy-js-devweb',
		'heddendorp',
		'tutkli',
		'Pascalmh',
		'okkindel',
		'oidre',
		'nartc',
		'santoshyadavdev',
		'markostanimirovic',
		'theo-matzavinos',
		'jkuri',
		'dongphuong0905',
		'DominikPieper',
		'brandonroberts',
		'izikd-',
		'ryancraigmartin',
		'gaetanBloch',
		'gergobergo',
		'rpacheco124',
		'benjaminforras',
		'jstnjs',
		'r3ps4J',
		'Celtian',
		'miljan-code',
		'alexciesielski',
		'ty-ler',
		'm-risto',
		'badsgahhl',
		'monacodelisa',
		'tomdev9',
		'ragul1697',
		'kkamman',
		'i-am-the-slime',
		'DevWedeloper',
		'mrsofiane',
		'mateoetchepare',
		'DonaldMurillo',
		'toniskobic',
		'eneajaho',
		'Den-dp',
		'0xfraso',
		'Muneersahel',
		'danilolmc',
		'tomalaforge',
		'canserkanuren',
		'cjosue15',
		'hirenchauhan2',
		'Roguyt',
		'tsironis13',
		'0xfraso',
		'guillermoecharri',
		'ValentinFunk',
		'Femi236',
		'dineshkp',
		'robingenz',
		'Balastrong',
		'OlegSuncrown',
		'stewones',
		'shinkhouse',
		'donaldxdonald',
		'BenoitPE',
		'miljan-code',
		'Georg632',
		'hillin',
		'Besbash',
		'davidedammino',
		'marcindz88',
		'thyco',
		'hitro11',
		'GODrums',
		'samsonkumawong',
		'PR4SAN',
		'JeevanMahesha',
		'dlhck',
		'tomer953',
		'drdreo',
		'OlegSuncrown',
		'tlandenberger',
		'yackinn',
		'OmerGronich',
		'kubalinio',
		'AlexHladin',
		'CO97',
		'MatanShushan',
		'maxhov',
		'josueggh',
		'namdien177',
		'zelenchuk',
		'a-malacarne',
		'YasinKuralay',
		'nico13051995',
		'francotalarico',
		'koenigderluegner',
		'Turtl3e',
		'minhnguyen120898',
		'liam-langstaff',
		'dw-0',
		'Khumozin',
		'abiramcodes',
		'garygrossgarten',
	];
	protected readonly _contributorCountRoundedToNextMultipleOf10 = Math.ceil(this._contributors.length / 10) * 10;
	protected readonly _countNeededToGetToNextMultipleOf10 =
		this._contributorCountRoundedToNextMultipleOf10 - this._contributors.length;
	protected readonly _rest = Array(this._countNeededToGetToNextMultipleOf10 + 20).map((_, i) => i);
}
